﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：YS_QT_QUXIANJHYSQK实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class YS_QT_QUXIANJHYSQK
    {
        private double? m_db_n_caizhengjszj;

        private double? m_db_n_feigongyjjf;

        private double? m_db_n_gongyejjf;

        private double? m_db_n_hejijjf;

        private double? m_db_n_jieshuizj;

        private double? m_db_n_jihuawcl;

        private double? m_db_n_jihuaysl;

        private double? m_db_n_zichouzj;

        private decimal? m_dec_i_feigongyhs;

        private decimal? m_dec_i_feigongyjhl;

        private decimal? m_dec_i_feigongyjjl;

        private decimal? m_dec_i_feigongyxsl;

        private decimal? m_dec_i_gongshuizl;

        private decimal? m_dec_i_gongyehs;

        private decimal? m_dec_i_gongyejhl;

        private decimal? m_dec_i_gongyejjl;

        private decimal? m_dec_i_gongyexsl;

        private decimal? m_dec_i_hejihs;

        private decimal? m_dec_i_hejijhl;

        private decimal? m_dec_i_hejijjl;

        private decimal? m_dec_i_hejixsl;

        private decimal? m_dec_i_jieshuiqjsl;

        private decimal? m_dec_i_jieshuiqts;

        private decimal? m_dec_i_jieshuixms;

        private decimal? m_dec_i_jlzt;

        private decimal? m_dec_i_shuipinghhs;

        private decimal? m_dec_i_ym;

        private decimal? m_dec_i_zuigaorjsl;

        private decimal m_dec_id;

        private DateTime? m_DT_d_caozuosj;

        private string m_str_s_beiyong1;

        private string m_str_s_beiyong2;

        private string m_str_s_caozuor;

        private string m_str_s_quxian;

        /// <summary>
        ///     主键
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        ///     年月
        /// </summary>
        public decimal? I_YM
        {
            get { return m_dec_i_ym; }
            set { m_dec_i_ym = value; }
        }

        /// <summary>
        ///     区县
        /// </summary>
        public string S_QUXIAN
        {
            get { return m_str_s_quxian; }
            set { m_str_s_quxian = value; }
        }

        /// <summary>
        ///     合计户数
        /// </summary>
        public decimal? I_HEJIHS
        {
            get { return m_dec_i_hejihs; }
            set { m_dec_i_hejihs = value; }
        }

        /// <summary>
        ///     工业户数
        /// </summary>
        public decimal? I_GONGYEHS
        {
            get { return m_dec_i_gongyehs; }
            set { m_dec_i_gongyehs = value; }
        }

        /// <summary>
        ///     非工业户数
        /// </summary>
        public decimal? I_FEIGONGYHS
        {
            get { return m_dec_i_feigongyhs; }
            set { m_dec_i_feigongyhs = value; }
        }

        /// <summary>
        ///     合计计划量
        /// </summary>
        public decimal? I_HEJIJHL
        {
            get { return m_dec_i_hejijhl; }
            set { m_dec_i_hejijhl = value; }
        }

        /// <summary>
        ///     工业计划量
        /// </summary>
        public decimal? I_GONGYEJHL
        {
            get { return m_dec_i_gongyejhl; }
            set { m_dec_i_gongyejhl = value; }
        }

        /// <summary>
        ///     非工业计划量
        /// </summary>
        public decimal? I_FEIGONGYJHL
        {
            get { return m_dec_i_feigongyjhl; }
            set { m_dec_i_feigongyjhl = value; }
        }

        /// <summary>
        ///     合计新水量
        /// </summary>
        public decimal? I_HEJIXSL
        {
            get { return m_dec_i_hejixsl; }
            set { m_dec_i_hejixsl = value; }
        }

        /// <summary>
        ///     工业新水量
        /// </summary>
        public decimal? I_GONGYEXSL
        {
            get { return m_dec_i_gongyexsl; }
            set { m_dec_i_gongyexsl = value; }
        }

        /// <summary>
        ///     非工业新水量
        /// </summary>
        public decimal? I_FEIGONGYXSL
        {
            get { return m_dec_i_feigongyxsl; }
            set { m_dec_i_feigongyxsl = value; }
        }

        /// <summary>
        ///     合计加价量
        /// </summary>
        public decimal? I_HEJIJJL
        {
            get { return m_dec_i_hejijjl; }
            set { m_dec_i_hejijjl = value; }
        }

        /// <summary>
        ///     工业加价量
        /// </summary>
        public decimal? I_GONGYEJJL
        {
            get { return m_dec_i_gongyejjl; }
            set { m_dec_i_gongyejjl = value; }
        }

        /// <summary>
        ///     非工业加价量
        /// </summary>
        public decimal? I_FEIGONGYJJL
        {
            get { return m_dec_i_feigongyjjl; }
            set { m_dec_i_feigongyjjl = value; }
        }

        /// <summary>
        ///     合计加价费
        /// </summary>
        public double? N_HEJIJJF
        {
            get { return m_db_n_hejijjf; }
            set { m_db_n_hejijjf = value; }
        }

        /// <summary>
        ///     工业加价费
        /// </summary>
        public double? N_GONGYEJJF
        {
            get { return m_db_n_gongyejjf; }
            set { m_db_n_gongyejjf = value; }
        }

        /// <summary>
        ///     非工业加价费
        /// </summary>
        public double? N_FEIGONGYJJF
        {
            get { return m_db_n_feigongyjjf; }
            set { m_db_n_feigongyjjf = value; }
        }

        /// <summary>
        ///     计划完成率
        /// </summary>
        public double? N_JIHUAWCL
        {
            get { return m_db_n_jihuawcl; }
            set { m_db_n_jihuawcl = value; }
        }

        /// <summary>
        ///     供水总量
        /// </summary>
        public decimal? I_GONGSHUIZL
        {
            get { return m_dec_i_gongshuizl; }
            set { m_dec_i_gongshuizl = value; }
        }

        /// <summary>
        ///     计划用水率
        /// </summary>
        public double? N_JIHUAYSL
        {
            get { return m_db_n_jihuaysl; }
            set { m_db_n_jihuaysl = value; }
        }

        /// <summary>
        ///     水平衡户数
        /// </summary>
        public decimal? I_SHUIPINGHHS
        {
            get { return m_dec_i_shuipinghhs; }
            set { m_dec_i_shuipinghhs = value; }
        }

        /// <summary>
        ///     节水项目数
        /// </summary>
        public decimal? I_JIESHUIXMS
        {
            get { return m_dec_i_jieshuixms; }
            set { m_dec_i_jieshuixms = value; }
        }

        /// <summary>
        ///     最高日节水量
        /// </summary>
        public decimal? I_ZUIGAORJSL
        {
            get { return m_dec_i_zuigaorjsl; }
            set { m_dec_i_zuigaorjsl = value; }
        }

        /// <summary>
        ///     节水资金
        /// </summary>
        public double? N_JIESHUIZJ
        {
            get { return m_db_n_jieshuizj; }
            set { m_db_n_jieshuizj = value; }
        }

        /// <summary>
        ///     节水器套数
        /// </summary>
        public decimal? I_JIESHUIQTS
        {
            get { return m_dec_i_jieshuiqts; }
            set { m_dec_i_jieshuiqts = value; }
        }

        /// <summary>
        ///     节水器节水量
        /// </summary>
        public decimal? I_JIESHUIQJSL
        {
            get { return m_dec_i_jieshuiqjsl; }
            set { m_dec_i_jieshuiqjsl = value; }
        }

        /// <summary>
        ///     财政节水资金
        /// </summary>
        public double? N_CAIZHENGJSZJ
        {
            get { return m_db_n_caizhengjszj; }
            set { m_db_n_caizhengjszj = value; }
        }

        /// <summary>
        ///     是否逻辑删除
        /// </summary>
        public decimal? I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        ///     备用1
        /// </summary>
        public string S_BEIYONG1
        {
            get { return m_str_s_beiyong1; }
            set { m_str_s_beiyong1 = value; }
        }

        /// <summary>
        ///     备用2
        /// </summary>
        public string S_BEIYONG2
        {
            get { return m_str_s_beiyong2; }
            set { m_str_s_beiyong2 = value; }
        }

        /// <summary>
        ///     自筹资金
        /// </summary>
        public double? N_ZICHOUZJ
        {
            get { return m_db_n_zichouzj; }
            set { m_db_n_zichouzj = value; }
        }

        /// <summary>
        ///     操作人
        /// </summary>
        public string S_CAOZUOR
        {
            get { return m_str_s_caozuor; }
            set { m_str_s_caozuor = value; }
        }

        /// <summary>
        ///     操作时间
        /// </summary>
        public DateTime? D_CAOZUOSJ
        {
            get { return m_DT_d_caozuosj; }
            set { m_DT_d_caozuosj = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class YS_QT_QUXIANJHYSQKProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public YS_QT_QUXIANJHYSQKProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据YS_QT_QUXIANJHYSQK实体添加或者修改YS_QT_QUXIANJHYSQK信息
        /// </summary>
        public bool InsertOrUpdate(YS_QT_QUXIANJHYSQK YS_QT_QUXIANJHYSQK, OracleTransaction Transaction)
        {
            if (YS_QT_QUXIANJHYSQK.ID == 0)
                InsertYS_QT_QUXIANJHYSQK(YS_QT_QUXIANJHYSQK, Transaction);
            else
                UpdateYS_QT_QUXIANJHYSQK(YS_QT_QUXIANJHYSQK, Transaction);
            return YS_QT_QUXIANJHYSQK.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_QT_QUXIANJHYSQK实体添加或修改YS_QT_QUXIANJHYSQK信息
        /// </summary>
        public bool InsertOrUpdate(YS_QT_QUXIANJHYSQK YS_QT_QUXIANJHYSQK)
        {
            return InsertOrUpdate(YS_QT_QUXIANJHYSQK, null);
        }


        /// <summary>
        ///     根据YS_QT_QUXIANJHYSQK主键删除YS_QT_QUXIANJHYSQK信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_QT_QUXIANJHYSQK(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_QT_QUXIANJHYSQK";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_QT_QUXIANJHYSQK主键删除YS_QT_QUXIANJHYSQK信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_QT_QUXIANJHYSQK(decimal ID)
        {
            return DeleteYS_QT_QUXIANJHYSQK(ID, null);
        }

        /// <summary>
        ///     根据条件删除YS_QT_QUXIANJHYSQK信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_QT_QUXIANJHYSQKsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_QT_QUXIANJHYSQKsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除YS_QT_QUXIANJHYSQK信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_QT_QUXIANJHYSQKsDynamic(string WhereClause)
        {
            return DeleteYS_QT_QUXIANJHYSQKsDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据YS_QT_QUXIANJHYSQK主键选择YS_QT_QUXIANJHYSQK信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_QT_QUXIANJHYSQK信息</returns>
        public YS_QT_QUXIANJHYSQK SelectYS_QT_QUXIANJHYSQK(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_QT_QUXIANJHYSQK";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var YS_QT_QUXIANJHYSQK = PopulateYS_QT_QUXIANJHYSQK(rd);
                rd.Close();
                return YS_QT_QUXIANJHYSQK;
            }
            return null;
        }

        /// <summary>
        ///     根据YS_QT_QUXIANJHYSQK主键选择YS_QT_QUXIANJHYSQK信息
        /// </summary>
        /// <returns>YS_QT_QUXIANJHYSQK信息</returns>
        public YS_QT_QUXIANJHYSQK SelectYS_QT_QUXIANJHYSQK(decimal ID)
        {
            return SelectYS_QT_QUXIANJHYSQK(ID, null);
        }

        /// <summary>
        ///     选择所有YS_QT_QUXIANJHYSQK信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有YS_QT_QUXIANJHYSQK信息</returns>
        public DataTable SelectYS_QT_QUXIANJHYSQKsAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_QT_QUXIANJHYSQKsAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有YS_QT_QUXIANJHYSQK信息
        /// </summary>
        /// <returns>所有YS_QT_QUXIANJHYSQK信息</returns>
        public DataTable SelectYS_QT_QUXIANJHYSQKsAll()
        {
            return SelectYS_QT_QUXIANJHYSQKsAll(null);
        }

        /// <summary>
        ///     根据条件选择YS_QT_QUXIANJHYSQK信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_QT_QUXIANJHYSQK信息</returns>
        public DataTable SelectYS_QT_QUXIANJHYSQKsDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_QT_QUXIANJHYSQKsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_QT_QUXIANJHYSQK信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>YS_QT_QUXIANJHYSQK信息</returns>
        public DataTable SelectYS_QT_QUXIANJHYSQKsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectYS_QT_QUXIANJHYSQKsDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择YS_QT_QUXIANJHYSQK信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_QT_QUXIANJHYSQK信息</returns>
        public DataTable SelectYS_QT_QUXIANJHYSQKsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_QT_QUXIANJHYSQKsDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_QT_QUXIANJHYSQK信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>YS_QT_QUXIANJHYSQK信息</returns>
        public DataTable SelectYS_QT_QUXIANJHYSQKsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectYS_QT_QUXIANJHYSQKsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新YS_QT_QUXIANJHYSQK字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_QT_QUXIANJHYSQKsDynamic(string UpdateValue, string WhereClause,
            OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdYS_QT_QUXIANJHYSQKDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新YS_QT_QUXIANJHYSQK字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_QT_QUXIANJHYSQKsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateYS_QT_QUXIANJHYSQKsDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertYS_QT_QUXIANJHYSQK(YS_QT_QUXIANJHYSQK YS_QT_QUXIANJHYSQK, OracleTransaction Transaction)
        {
            var spName = "CS_InsYS_QT_QUXIANJHYSQK";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_QT_QUXIANJHYSQK.I_YM;
            storedParams[1].Value = YS_QT_QUXIANJHYSQK.S_QUXIAN;
            storedParams[2].Value = YS_QT_QUXIANJHYSQK.I_HEJIHS;
            storedParams[3].Value = YS_QT_QUXIANJHYSQK.I_GONGYEHS;
            storedParams[4].Value = YS_QT_QUXIANJHYSQK.I_FEIGONGYHS;
            storedParams[5].Value = YS_QT_QUXIANJHYSQK.I_HEJIJHL;
            storedParams[6].Value = YS_QT_QUXIANJHYSQK.I_GONGYEJHL;
            storedParams[7].Value = YS_QT_QUXIANJHYSQK.I_FEIGONGYJHL;
            storedParams[8].Value = YS_QT_QUXIANJHYSQK.I_HEJIXSL;
            storedParams[9].Value = YS_QT_QUXIANJHYSQK.I_GONGYEXSL;
            storedParams[10].Value = YS_QT_QUXIANJHYSQK.I_FEIGONGYXSL;
            storedParams[11].Value = YS_QT_QUXIANJHYSQK.I_HEJIJJL;
            storedParams[12].Value = YS_QT_QUXIANJHYSQK.I_GONGYEJJL;
            storedParams[13].Value = YS_QT_QUXIANJHYSQK.I_FEIGONGYJJL;
            storedParams[14].Value = YS_QT_QUXIANJHYSQK.N_HEJIJJF;
            storedParams[15].Value = YS_QT_QUXIANJHYSQK.N_GONGYEJJF;
            storedParams[16].Value = YS_QT_QUXIANJHYSQK.N_FEIGONGYJJF;
            storedParams[17].Value = YS_QT_QUXIANJHYSQK.N_JIHUAWCL;
            storedParams[18].Value = YS_QT_QUXIANJHYSQK.I_GONGSHUIZL;
            storedParams[19].Value = YS_QT_QUXIANJHYSQK.N_JIHUAYSL;
            storedParams[20].Value = YS_QT_QUXIANJHYSQK.I_SHUIPINGHHS;
            storedParams[21].Value = YS_QT_QUXIANJHYSQK.I_JIESHUIXMS;
            storedParams[22].Value = YS_QT_QUXIANJHYSQK.I_ZUIGAORJSL;
            storedParams[23].Value = YS_QT_QUXIANJHYSQK.N_JIESHUIZJ;
            storedParams[24].Value = YS_QT_QUXIANJHYSQK.I_JIESHUIQTS;
            storedParams[25].Value = YS_QT_QUXIANJHYSQK.I_JIESHUIQJSL;
            storedParams[26].Value = YS_QT_QUXIANJHYSQK.N_CAIZHENGJSZJ;
            storedParams[27].Value = YS_QT_QUXIANJHYSQK.I_JLZT;
            storedParams[28].Value = YS_QT_QUXIANJHYSQK.S_BEIYONG1;
            storedParams[29].Value = YS_QT_QUXIANJHYSQK.S_BEIYONG2;
            storedParams[30].Value = YS_QT_QUXIANJHYSQK.N_ZICHOUZJ;
            storedParams[31].Value = YS_QT_QUXIANJHYSQK.S_CAOZUOR;
            storedParams[32].Value = YS_QT_QUXIANJHYSQK.D_CAOZUOSJ;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            YS_QT_QUXIANJHYSQK.ID = Convert.ToInt32(storedParams[33].Value);
            return result;
        }

        private bool UpdateYS_QT_QUXIANJHYSQK(YS_QT_QUXIANJHYSQK YS_QT_QUXIANJHYSQK, OracleTransaction Transaction)
        {
            var spName = "CS_UpdYS_QT_QUXIANJHYSQK";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_QT_QUXIANJHYSQK.I_YM;
            storedParams[1].Value = YS_QT_QUXIANJHYSQK.S_QUXIAN;
            storedParams[2].Value = YS_QT_QUXIANJHYSQK.I_HEJIHS;
            storedParams[3].Value = YS_QT_QUXIANJHYSQK.I_GONGYEHS;
            storedParams[4].Value = YS_QT_QUXIANJHYSQK.I_FEIGONGYHS;
            storedParams[5].Value = YS_QT_QUXIANJHYSQK.I_HEJIJHL;
            storedParams[6].Value = YS_QT_QUXIANJHYSQK.I_GONGYEJHL;
            storedParams[7].Value = YS_QT_QUXIANJHYSQK.I_FEIGONGYJHL;
            storedParams[8].Value = YS_QT_QUXIANJHYSQK.I_HEJIXSL;
            storedParams[9].Value = YS_QT_QUXIANJHYSQK.I_GONGYEXSL;
            storedParams[10].Value = YS_QT_QUXIANJHYSQK.I_FEIGONGYXSL;
            storedParams[11].Value = YS_QT_QUXIANJHYSQK.I_HEJIJJL;
            storedParams[12].Value = YS_QT_QUXIANJHYSQK.I_GONGYEJJL;
            storedParams[13].Value = YS_QT_QUXIANJHYSQK.I_FEIGONGYJJL;
            storedParams[14].Value = YS_QT_QUXIANJHYSQK.N_HEJIJJF;
            storedParams[15].Value = YS_QT_QUXIANJHYSQK.N_GONGYEJJF;
            storedParams[16].Value = YS_QT_QUXIANJHYSQK.N_FEIGONGYJJF;
            storedParams[17].Value = YS_QT_QUXIANJHYSQK.N_JIHUAWCL;
            storedParams[18].Value = YS_QT_QUXIANJHYSQK.I_GONGSHUIZL;
            storedParams[19].Value = YS_QT_QUXIANJHYSQK.N_JIHUAYSL;
            storedParams[20].Value = YS_QT_QUXIANJHYSQK.I_SHUIPINGHHS;
            storedParams[21].Value = YS_QT_QUXIANJHYSQK.I_JIESHUIXMS;
            storedParams[22].Value = YS_QT_QUXIANJHYSQK.I_ZUIGAORJSL;
            storedParams[23].Value = YS_QT_QUXIANJHYSQK.N_JIESHUIZJ;
            storedParams[24].Value = YS_QT_QUXIANJHYSQK.I_JIESHUIQTS;
            storedParams[25].Value = YS_QT_QUXIANJHYSQK.I_JIESHUIQJSL;
            storedParams[26].Value = YS_QT_QUXIANJHYSQK.N_CAIZHENGJSZJ;
            storedParams[27].Value = YS_QT_QUXIANJHYSQK.I_JLZT;
            storedParams[28].Value = YS_QT_QUXIANJHYSQK.S_BEIYONG1;
            storedParams[29].Value = YS_QT_QUXIANJHYSQK.S_BEIYONG2;
            storedParams[30].Value = YS_QT_QUXIANJHYSQK.N_ZICHOUZJ;
            storedParams[31].Value = YS_QT_QUXIANJHYSQK.S_CAOZUOR;
            storedParams[32].Value = YS_QT_QUXIANJHYSQK.D_CAOZUOSJ;
            storedParams[33].Value = YS_QT_QUXIANJHYSQK.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private YS_QT_QUXIANJHYSQK PopulateYS_QT_QUXIANJHYSQK(IDataReader dr)
        {
            var YS_QT_QUXIANJHYSQK = new YS_QT_QUXIANJHYSQK();
            YS_QT_QUXIANJHYSQK.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            YS_QT_QUXIANJHYSQK.I_YM = dr["I_YM"] == DBNull.Value ? null : (decimal?) dr["I_YM"];
            YS_QT_QUXIANJHYSQK.S_QUXIAN = dr["S_QUXIAN"] == DBNull.Value ? null : (string) dr["S_QUXIAN"];
            YS_QT_QUXIANJHYSQK.I_HEJIHS = dr["I_HEJIHS"] == DBNull.Value ? null : (decimal?) dr["I_HEJIHS"];
            YS_QT_QUXIANJHYSQK.I_GONGYEHS = dr["I_GONGYEHS"] == DBNull.Value ? null : (decimal?) dr["I_GONGYEHS"];
            YS_QT_QUXIANJHYSQK.I_FEIGONGYHS = dr["I_FEIGONGYHS"] == DBNull.Value ? null : (decimal?) dr["I_FEIGONGYHS"];
            YS_QT_QUXIANJHYSQK.I_HEJIJHL = dr["I_HEJIJHL"] == DBNull.Value ? null : (decimal?) dr["I_HEJIJHL"];
            YS_QT_QUXIANJHYSQK.I_GONGYEJHL = dr["I_GONGYEJHL"] == DBNull.Value ? null : (decimal?) dr["I_GONGYEJHL"];
            YS_QT_QUXIANJHYSQK.I_FEIGONGYJHL =
                dr["I_FEIGONGYJHL"] == DBNull.Value ? null : (decimal?) dr["I_FEIGONGYJHL"];
            YS_QT_QUXIANJHYSQK.I_HEJIXSL = dr["I_HEJIXSL"] == DBNull.Value ? null : (decimal?) dr["I_HEJIXSL"];
            YS_QT_QUXIANJHYSQK.I_GONGYEXSL = dr["I_GONGYEXSL"] == DBNull.Value ? null : (decimal?) dr["I_GONGYEXSL"];
            YS_QT_QUXIANJHYSQK.I_FEIGONGYXSL =
                dr["I_FEIGONGYXSL"] == DBNull.Value ? null : (decimal?) dr["I_FEIGONGYXSL"];
            YS_QT_QUXIANJHYSQK.I_HEJIJJL = dr["I_HEJIJJL"] == DBNull.Value ? null : (decimal?) dr["I_HEJIJJL"];
            YS_QT_QUXIANJHYSQK.I_GONGYEJJL = dr["I_GONGYEJJL"] == DBNull.Value ? null : (decimal?) dr["I_GONGYEJJL"];
            YS_QT_QUXIANJHYSQK.I_FEIGONGYJJL =
                dr["I_FEIGONGYJJL"] == DBNull.Value ? null : (decimal?) dr["I_FEIGONGYJJL"];
            YS_QT_QUXIANJHYSQK.N_HEJIJJF = dr["N_HEJIJJF"] == DBNull.Value ? null : (double?) dr["N_HEJIJJF"];
            YS_QT_QUXIANJHYSQK.N_GONGYEJJF = dr["N_GONGYEJJF"] == DBNull.Value ? null : (double?) dr["N_GONGYEJJF"];
            YS_QT_QUXIANJHYSQK.N_FEIGONGYJJF =
                dr["N_FEIGONGYJJF"] == DBNull.Value ? null : (double?) dr["N_FEIGONGYJJF"];
            YS_QT_QUXIANJHYSQK.N_JIHUAWCL = dr["N_JIHUAWCL"] == DBNull.Value ? null : (double?) dr["N_JIHUAWCL"];
            YS_QT_QUXIANJHYSQK.I_GONGSHUIZL = dr["I_GONGSHUIZL"] == DBNull.Value ? null : (decimal?) dr["I_GONGSHUIZL"];
            YS_QT_QUXIANJHYSQK.N_JIHUAYSL = dr["N_JIHUAYSL"] == DBNull.Value ? null : (double?) dr["N_JIHUAYSL"];
            YS_QT_QUXIANJHYSQK.I_SHUIPINGHHS =
                dr["I_SHUIPINGHHS"] == DBNull.Value ? null : (decimal?) dr["I_SHUIPINGHHS"];
            YS_QT_QUXIANJHYSQK.I_JIESHUIXMS = dr["I_JIESHUIXMS"] == DBNull.Value ? null : (decimal?) dr["I_JIESHUIXMS"];
            YS_QT_QUXIANJHYSQK.I_ZUIGAORJSL = dr["I_ZUIGAORJSL"] == DBNull.Value ? null : (decimal?) dr["I_ZUIGAORJSL"];
            YS_QT_QUXIANJHYSQK.N_JIESHUIZJ = dr["N_JIESHUIZJ"] == DBNull.Value ? null : (double?) dr["N_JIESHUIZJ"];
            YS_QT_QUXIANJHYSQK.I_JIESHUIQTS = dr["I_JIESHUIQTS"] == DBNull.Value ? null : (decimal?) dr["I_JIESHUIQTS"];
            YS_QT_QUXIANJHYSQK.I_JIESHUIQJSL =
                dr["I_JIESHUIQJSL"] == DBNull.Value ? null : (decimal?) dr["I_JIESHUIQJSL"];
            YS_QT_QUXIANJHYSQK.N_CAIZHENGJSZJ =
                dr["N_CAIZHENGJSZJ"] == DBNull.Value ? null : (double?) dr["N_CAIZHENGJSZJ"];
            YS_QT_QUXIANJHYSQK.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?) dr["I_JLZT"];
            YS_QT_QUXIANJHYSQK.S_BEIYONG1 = dr["S_BEIYONG1"] == DBNull.Value ? null : (string) dr["S_BEIYONG1"];
            YS_QT_QUXIANJHYSQK.S_BEIYONG2 = dr["S_BEIYONG2"] == DBNull.Value ? null : (string) dr["S_BEIYONG2"];
            YS_QT_QUXIANJHYSQK.N_ZICHOUZJ = dr["N_ZICHOUZJ"] == DBNull.Value ? null : (double?) dr["N_ZICHOUZJ"];
            YS_QT_QUXIANJHYSQK.S_CAOZUOR = dr["S_CAOZUOR"] == DBNull.Value ? null : (string) dr["S_CAOZUOR"];
            YS_QT_QUXIANJHYSQK.D_CAOZUOSJ = dr["D_CAOZUOSJ"] == DBNull.Value ? null : (DateTime?) dr["D_CAOZUOSJ"];
            return YS_QT_QUXIANJHYSQK;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion